/**
 * 引入主库
 */
import React, { Component } from 'react'

/** 引入路由依赖 */
import {
    BrowserRouter as Router,
    Switch,
    Route,
    Redirect,
    Link,
    NavLink
} from 'react-router-dom'

/** 登录页面 */
import Login from './pages/Common/Login'

/** 404页面 */
import NotFound from './pages/Common/NotFound'

/** Home Page */
import HomePage from './pages/Home'

/** 关注页面 */
import Follow from './pages/Follow'

/** A店页面 */
import Shop from './pages/Shop'

/** 我 */
import User from './pages/User'

/**
 * 主组件
 */
class App extends Component {
    render() {
        return (
            <div>
                <Router>
                    <div>
                        <Link to="/login">登录页面</Link>
                        <Link to="/404">404</Link>
                        <Link to="/home">首页</Link>
                        <NavLink to="/follow">关注</NavLink>
                        <NavLink to="/shop">A店</NavLink>
                        <NavLink to="/user">我</NavLink>
                    </div>
                    <Switch>
                        <Route component={Login} path="/login"/>
                        <Route component={NotFound} path="/404"/>
                        <Route component={HomePage} path="/home"/>
                        <Route component={Follow} path="/follow"/>
                        <Route component={Shop} path="/shop"/>
                        <Route component={User} path="/user"/>
                        <Redirect from="/" to="/login" exact/>
                        <Redirect to="/404"/>
                    </Switch>
                </Router>
            </div>
        )
    }
}
export default App